<!doctype html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Amaze UI Admin index Examples</title>
<meta name="description" content="这是一个页面">
<meta name="keywords" content="edit">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png"
	href="${ctx}/static/i/favicon.png">
<link rel="apple-touch-icon-precomposed"
	href="${ctx}/static/i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet"
	href="${ctx}/static/css/amazeui.min.css" />
<link rel="stylesheet"
	href="${ctx}/static/css/admin.css">
<link rel="stylesheet" href="${ctx}/static/css/app.css">
<link rel="stylesheet" href="${ctx}/static/css/main.css">
<link rel="stylesheet"
	href="${ctx}/static/ztree/zTreeStyle.css">
<style type="text/css">
body ol.am-breadcrumb {
      padding-top:0;
      margin:0;
      margin-bottom:10px;
      
}
.return {
	width: 20px;
	margin-right: 10px;
}

.am-form-group {
	position: relative;
}

.chance {
	display: inline-block;
	position: absolute;
	width: 100px;
	z-index: 99;
	top: 28px;
	height: 35px;
	right: 0;
	color: #fff;
	background: #3bb4f2;
}

.bottomdiv {
	width: 100%;
	position: absolute;
	bottom: 0;
	left: 0;
	background: #d3d3d3;
	padding: 5px 0;
}

.bottomdiv button {
	float: right;
	margin-right: 30px;
}
</style>
</head>

<body data-type="generalComponents">
	<ol class="am-breadcrumb">
		<img src="${ctx}/static/img/return.png" class="return" />
		<li><a href="${ctx}/index" class="am-icon-home">首页</a></li>
		<li><a href="${ctx}/user">用户管理</a></li>
		<li class="am-active">用户信息修改</li>
	</ol>
		<div class="tpl-portlet-components">
			<div class="portlet-title">
				<div class="caption font-green bold">
					<span class="am-icon-code"></span>修改信息
				</div>
			</div>
		<div class="tpl-block ">

		<div class="am-g tpl-amazeui-form" style="text-align: center;">
			<div style="width: 75%; margin: 0 auto; text-align: left; font-size: 14px;">
			<form data-href="${ctx}/user/edit" class="am-form" id="doc-vld-msg"  method="post">
				<fieldset>
					<input type="hidden" name="userId" value="${user.userId!}">
					<div class="am-form-group">
						<label for="doc-vld-name-2-1">用户名：</label> <input type="text"
							name="username" value="${user.username!}" id="doc-vld-name-2-1"
							minlength="2" placeholder="输入用户名（至少 2个字符）" readonly required />
					</div>
					<div class="am-form-group">
						<label for="doc-vld-name-2-1">真实姓名：</label> <input type="text"
							name="name" value="${user.name!}" id="doc-vld-name-2-2"
							minlength="2" placeholder="输入真实姓名（至少 2 个字符）" required />
					</div>
					<div class="am-form-group" id="sexval" data-val="${user.sex!}">
							<label>性别： </label> <label class="am-radio-inline">
						      <label class="am-radio-inline">
						        <input type="radio" name="sex" value="男">男
						      </label>
						      <label class="am-radio-inline">
						        <input type="radio" name="sex"  value="女">女
						      </label>
						    </div>

					<div class="am-form-group">
						<label for="doc-vld-age-2-1">年龄：</label> <input type="number"
							class="" value="${user.age!}" name="age" id="doc-vld-age-2-1"
							placeholder="输入年龄  12-120" min="12" max="120" required />
					</div>
					<div class="am-form-group">
						<label for="doc-vld-age-2-1">手机号：</label> <input type="number"
							class="" value="${user.phoneNumber!}" name="phoneNumber"
							id="doc-vld-age-2-2" maxlength="11" pattern="^1(3|4|5|6|7|8)[0-9]\d{8}$" placeholder="手机号" required />
					</div>
					<div class="am-form-group">
                          <label for="doc-vld-email-2-1">邮箱：</label>
                              <input type="email" id="doc-vld-email-2-1" name="email"  value="${user.email!}"  data-validation-message="请输入地球上的电子邮箱" placeholder="输入邮箱" required/>
                    </div>
                              
                    <div class="am-form-group">
                         <label for="doc-vld-name-2-1">身份证号：</label>
                         <input type="text" id="doc-vld-name-2-1" minlength="18" maxlength="18" name="idCard" value="${user.idCard!}"  required/>
                     </div>
                      <div class="am-form-group">
                                    <label for="doc-select-1-1">身份类型：</label>
                                    <select id="doc-select-1-1" name="userType">
                                    <#if user.userType="0">
                                    <option value="0" selected>超级管理员</option>
                                        <option value="2" >会员</option>
                                        <option value="1" >普通管理员</option>
                                    </#if>
                                   		<#if user.userType="1">
                                    	<option value="2" >普通用户</option>
                                        <option value="1" selected>管理员</option>
                                    </#if>
                                    <#if user.userType="2">
                                        <option value="2" selected>普通用户</option>
                                        <option value="1" >管理员</option>
                                    </#if>
                                    </select>
                                    <span class="am-form-caret"></span>
                                  </div>
					<button type="submit" class="am-btn am-btn-secondary qued">确定</button>
				</fieldset>
			</form>

		</div>
</div>
	</div>

	<script type="text/javascript"
		src="${ctx}/static/js/jquery.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/js/amazeui.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/js/app.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/js/form.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/js/distpicker.data.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/js/distpicker.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/ztree/jquery.ztree.all.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/ztree/jquery.ztree.core.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/ztree/jquery.ztree.excheck.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/ztree/jquery.ztree.exedit.min.js"></script>
	<script type="text/javascript"
		src="${ctx}/static/ztree/jquery.ztree.exhide.min.js"></script>
		<script src="${ctx}/static/js/public.js"></script>	
	<script>
		var name = "";//获取的标题
		var titleid = "";//获取的id
		$(".return").click(function() {//返回上一页
			history.go(-1);
		});
		$(document).ready(function() {
          var val= $("#sexval").attr("data-val");

          if(val=="男"){
        	  $("#sexval").find("input").eq(0).attr("checked","checked");
          }
          if(val=="女"){
        	  $("#sexval").find("input").eq(1).attr("checked","checked");
          }
          
          
          $('#doc-vld-msg').submit(function() {
 			  var num =  $(".am-field-error").length; 
 			if(num==0){
 				var urls=$("#doc-vld-msg").attr("data-href");
 				ajaxForm(urls);
 			}
 			return false;
			}); 
		});
		
	 		
	</script>
</body>

</html>